from jili.calc import calcor_base

class isnew_high(calcor_base):
    def __init__(self,ta_arg={}):
        self.out = ["isnew_high"]
        self.input = ["close"]
        self.parameters = {"timeperiod":60}
        super().__init__(ta_arg)
        self.batch=self.parameters["timeperiod"]
        self.lookback = self.batch - 1
    def calc(self):
        data=self.hisbars[self.input[0]]
        max=data.max()
        rst=False
        if data[-1]>=max:
            rst=True
        return rst